using System;
using System.Collections.Generic;
using System.Text;
using Sedna.Core.Security;

namespace Sedna.Core.Controller
{
    public class PrincipalBasedGridPaging : IGridPageSizeResolver
    {
        private IPrincipalWrapper principalWrapper;

        public IPrincipalWrapper PrincipalWrapper
        {
            get { return principalWrapper; }
            set { principalWrapper = value; }
        }

        public int PageSize
        {
            get
            {
                return
                    (principalWrapper == null || !principalWrapper.PageSize.HasValue)
                        ? 0
                        : principalWrapper.PageSize.Value;
            }
        }
    }
}
